import request from '@/utils/request'

export const getComments =params=>{
    return request({
        method:'get',
        url:'/v1_0/comments',
        params
    })
}

// 对评论或评论回复点赞
export const addLike =target=>{
    return request({
        method:'post',
        url:'/v1_0/comment/likings',
        data:{
            target
        }
    })
}

// 取消对评论或评论回复点赞
export const deleteCommentLike =target=>{
    return request({
        method:'delete',
        url:`/v1_0/comment/likings/${target}`,
    })
}

 // 添加评论或评论回复
export const addComment =data=>{
    return request({
        method:'post',
        url:'/v1_0/comments',
        data
    })
}